package com.wuming.caiwu.service;


import com.wuming.caiwu.core.BusinessException;
import com.wuming.caiwu.model.SysUser;
import com.wuming.caiwu.model.SysUserDetail;

import java.util.List;

/**
 * 系统用户服务
 * Created by hanfei on 16/4/19.
 */
public interface SysUserService {

    /**
     * 保存用户信息
     *
     * @param member 用户信息
     * @throws BusinessException
     */
    void saveSysUser(SysUser member) throws BusinessException;

    /**
     * 更新用户信息
     *
     * @param member 用户信息
     * @throws BusinessException
     */
    void modifySysUser(SysUser member) throws BusinessException;

    /**
     * 根据id查询用户信息
     *
     * @param id 用户id
     * @return 用户信息
     * @throws BusinessException
     */
    SysUser getSysUserById(Long id) throws BusinessException;

    /**
     * 根据id删除用户信息
     *
     * @param id 用户id
     * @throws BusinessException
     */
    void removeSysUserById(Long id) throws BusinessException;


    /**
     * 分页查询用户列表
     *
     * @param username      用户名
     * @param qsgStoreId    店铺ID
     * @param pageIndex     当前页
     * @param pageSize      每页条数
     * @return 用户列表
     * @throws BusinessException
     */
    List<SysUser> getSysUsersByPage(String username, Long qsgStoreId, int pageIndex, int pageSize) throws BusinessException;

    /**
     * 查询总的用户数
     *
     * @param username    用户名
     * @param qsgStoreId  店铺ID
     * @return 用户总数
     * @throws BusinessException
     */
    int getTotal(String username, Long qsgStoreId) throws BusinessException;

    /**
     * 根据userId查询用户信息
     * @param userId  用戶ID
     * @return 用户信息
     * @throws BusinessException
     */
    SysUserDetail getUserDetailById(Long userId) throws BusinessException;

}
